import axiosServer from "@/utils/request";
// 修改规则函数
export const AddActivity = (
  name,
  currencyId,
  currencyName,
  rules,
  startTime,
  endTime,
  amount,
  rare
) => {
  return axiosServer({
    method: "post",
    url: "/api/awardCurrency/update",
    data: { name, currencyId, currencyName, rules, startTime, endTime, amount, rare },
  });
};
// 查询你规则
export const getAwardCurrency = () => {
  return axiosServer({
    method: "get",
    url: "/api/awardCurrency/findById",
  });
};
// 获取币种函数
export const getCurrency = () => {
  return axiosServer({
    method: "get",
    url: "/api/currency/list",
  });
};
//装备查询接口
export const getItemName = (id) => {
  return axiosServer({
    method: "get",
    url: "/item/loadByItemName/" + id,
  });
};
// 添加奖品接口*
export const AddJiangping = (itemId, name, num, myProbability) => {
  return axiosServer({
    method: "post",
    url: "/award/save",
    data: {
      itemId,
      name,
      num,
      myProbability,
    },
  });
};
// 奖品列表*
export const getAwardList = () => {
  return axiosServer({
    method: "get",
    url: "/award/listData",
  });
};
// 删除奖品*
export const deleteAward = (id) => {
  return axiosServer({
    method: "delete",
    url: "/award/delete/" + id,
  });
};

// 记录分页
export const postListData = (page, limit, userId, nickname, userName, startTime, endTime) => {
  return axiosServer({
    method: "get",
    url: "/awardLog/listData",
    params: { page, limit, userId, nickname, userName, startTime, endTime }
  });
};
